package com.qzimp.fujiancuo.service.impl;

import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.qzimp.fujiancuo.entity.Enterprise;
import com.qzimp.fujiancuo.entity.vo.ResultVo;
import com.qzimp.fujiancuo.mapper.EnterpriseMapper;
import com.qzimp.fujiancuo.service.EnterpriseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *  服务层实现。
 *
 * @author 吴宗波
 * @since 2024-11-21
 */
@Service
public class EnterpriseServiceImpl extends ServiceImpl<EnterpriseMapper, Enterprise> implements EnterpriseService {
    @Autowired
    private EnterpriseMapper enterpriseMapper;

    public ResultVo queryEnterpriseByCuoId(Integer id) {
        List<Enterprise> enterprises = enterpriseMapper.queryEnterpriseByCuoId(id);
        if (enterprises.isEmpty()) {
            return new ResultVo(1, "请求成功", "没有查到数据", true);
        }
        return new ResultVo(1, "请求成功", enterprises, true);
    }
}

